$(function(){
	var items = $("#lbgallery-album a");
	if(items.length > 0){
		$("#lbgallery-album a").lightBox();
	}
});

function deleteAlbum(redirect){
	var directTo = redirect;

	$("#confirmDeleteAlbum").dialog({
		autoOpen : true,
		width: 400,
		buttons: {
			"Yes" : function(){
				location.href = redirect;
				$(this).dialog("close");
			},
			"No" : function(){
				$(this).dialog("close");
			}
		},
		modal : true
	});
		
	if($("#confirmDeleteAlbum").dialog("isOpen") == false){
		$("#confirmDeleteAlbum").dialog("open");
	};
}

function lbgAddField(){
	var translation = $("#lang_choose_img").attr("value");
	$("#lbgallery-add-images").append("<p class=\"form\"><label for=\"upload_image\">" + translation + ":</label><input type=\"file\" name=\"upload_image[]\" /></p>");
}